|
The Microsoft Windows Script Host (WSH) is an automation technology for Microsoft Windows operating systems that provides scripting abilities comparable to batch files, but with a wider range of supported features. It was originally called ''Windows Scripting Host'', but was renamed for the second release. It is language-independent in that it can make use of different Active Scripting language engines. By default, it interprets and runs plain-text JScript (.JS and .JSE files) and VBScript (.VBS and .VBE files). Users can install different scripting engines to enable them to script in other languages, for instance PerlScript. The language independent filename extension WSF can also be used. The advantage of the Windows Script File (.WSF) is that it allows the user to use a combination of scripting languages within a single file. WSH engines include various implementations for the REXX, BASIC, Perl, Ruby, Tcl, PHP, JavaScript, Delphi, Python, XSLT, and other languages. Windows Script Host is distributed and installed by default on Windows 98 and later versions of Windows. It is also installed if Internet Explorer 5 (or a later version) is installed. Beginning with Windows 2000, the Windows Script Host became available for use with user login scripts. ==Usage== Windows Script Host may be used for a variety of purposes, including logon scripts, administration and general automation. Microsoft describes it as an ''administration tool''.〔(What is WSH? )〕 WSH provides an environment for scripts to run – it invokes the appropriate script engine and provides a set of services and objects for the script to work with.〔 These scripts may be run in either GUI mode (''WScript''.exe) or command line mode (''CScript''.exe) offering flexibility to the user for interactive or non-interactive scripts.〔(Windows Script Host Basics )〕 WSH implements an object model which exposes a set of Component Object Model (COM) interfaces.〔(Windows Script Host Object Model )〕 So in addition to ASP, IIS, Internet Explorer, CScript and WScript, the WSH can be used to automate and communicate with any Windows application with COM and other exposed objects, such as using PerlScript to query Microsoft Access, ooRexxScript to create what are in fact Rexx macros in Excel, Quattro Pro, Microsoft Word, Lotus Notes and any of the like, the XLNT script to get environment variables and print them in a new TextPad document, Python can be used to automate and query the data in SecureCRT . . . Unless otherwise specified, any WSH scripting engine can be used with the various Windows server software packages to provide CGI scripting. The current versions of the default WSH engines and all or most of the third party engines have socket abilities as well; as a CGI script or otherwise, PerlScript is the choice of many programmers for this purpose and the VBScript and various Rexx-based engines are also rated as sufficiently powerful in connectivity and text-processing abilities to also be useful. This also goes for file access and processing—the earliest WSH engines for VBScript and JScript do not since the base language did not,〔MSDN documentation〕 whilst PerlScript, ooRexxScript, and the others have this from the beginning. WinWrap Basic, SaxBasic and others are similar to Visual Basic for Applications, These tools are used to add scripting and macro abilities. Many other languages can also be used in this fashion. Other languages used for scripting of programmes include Rexx, Tcl, Perl, Python, Ruby, and others which come with methods to control objects in the operating system and the spreadsheet and database programmes.〔Windows Office 97 & 2000 Bibles (Wiley)〕 VBScript is the macro language in Microsoft Outlook 97, whilst WordBasic is used for Word up to 6, Powerpoint and other tools. Excel to 5.0 uses Visual Basic 5.0. In Office 2000 forward, true Visual Basic for Applications 6.0 is used for all components. Other components use Visual Basic for Applications. OpenOffice uses Visual Basic, Python, and several others as macro languages and others can be added. LotusScript is very closely related to VBA, and pure VBA licensed from Microsoft is used Corel products such as Lotus Notes, Lotus 1·2·3, Quattro Pro &c. Any scripting language connected to the Windows can be accessed by external means of PerlScript, PythonScript, VBScript and the other engines available can be used to access databases (Lotus Notes, Microsoft Access, Oracle), spreadsheets (Microsoft Excel Lotus 1·2·3, Quattro Pro. This can be accomplished by means of the WSH so any language can be used if there is an installed engine. 抄文引用元・出典: フリー百科事典『 ウィキペディア(Wikipedia)』 ■ウィキペディアで「Windows Script Host」の詳細全文を読む スポンサード リンク
|